<template>
  <div class="container width1200">
    <!-- <div class="title">
      <span>欢迎进入管理服务平台</span>
      <div @click="loginOut">
        <i class="el-icon-user"></i>
        <span style="margin-left: 10px; color: #999999">{{
          userInfo.userVO.applyType == "0" ? "个人用户:" : "企业用户:"
        }}</span>
        <span style="color: #333333">{{ userInfo.userVO.applicantName }}</span>
      </div>
    </div> -->
    <div class="main">
      <div class="ssnyd" style="display:flex;align-items:center;justify-content: space-between;">
        <div style="display:flex;align-items:center;justify-content: space-between;">
          <div style="margin-right: 5px">
            <img src="../assets/db1.png" height="15" alt="" />
          </div>
         <div class="name">
          <div style="font-size:16px">
            当前位置：在线办理>设施农用地
          </div>
        </div>
        </div>
      </div>
      <div class="ssnyd">
        <div class="name">
          <div>
            设施农业用地信息在线填报
            <span class="ssnyd-unit">（面积单位：公顷）</span>
          </div>
        </div>
        <el-divider></el-divider>
      </div>
      <div class="form-box">
        <el-form
          ref="form"
          :rules="rules"
          :model="formInline"
          label-width="180px"
          size="small"
          :disabled="formInline.status != '1' && formInline.status != '3'"
         >
          <el-col :span="24">
            <div class="form-section">基本情况</div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="项目名称">
              <!-- <el-select
                v-show="!isEditName"
                size="small"
                style="width: 50%"
                v-model="formInline.projectNo"
                @change="projectChange"
              >
                <el-option
                  v-for="(item, idx) in projectList"
                  :key="idx"
                  :label="item.projectName"
                  :value="item.projectNo"
                ></el-option>
              </el-select> -->
              <div class="name">
                <el-input  v-model="formInline.projectName"></el-input>
                <div
                  v-if="formInline && formInline.status != '0'"
                  :class="`status-${formInline.status}`"
                >
                  {{ getStatus(formInline.status) }}
                </div>
                <div
                  class="re-send"
                  v-else-if="formInline.status == '0' || formInline.status == null"
                >
                  <el-button @click="resend" type="primary" size="small"
                    >重新推送</el-button
                  >
                </div>
              </div>
              
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="经营者名称">
              <el-input
                :disabled="true"
                v-model="
                  formInline.applyType == '0'
                    ? formInline.applicantName
                    : formInline.companyName
                "
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="法人代表">
              <el-input
                :disabled="true"
                v-model="
                  formInline.applyType == '0' ? '' : formInline.applicantName
                "
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系方式">
              <el-input
                :disabled="true"
                v-model="formInline.telephone"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="建设地点">
              <el-input
                @change="addressChange"
                v-model="address"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="用途" prop="fayt">
              <el-select
                style="width=300px"
                size="small"
                v-model="formInline.fayt"
                @change="userTypeChange"
              >
                <el-option
                  v-for="(item, idx) in jsytData"
                  :key="idx"
                  :label="item.dictLabel"
                  :value="item.dictLabel"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="投资规模">
              <el-input :disabled="true" v-model="formInline.tzgm"></el-input>
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="拟使用土地截止时间">
              <el-input
                :disabled="true"
                v-model="formInline.finalDate"
              ></el-input>
            </el-form-item>
          </el-col> -->
          <el-col :span="12">
            <el-form-item label="设施建设类型" prop="ssjslx">
              <el-radio-group v-model="formInline.ssjslx">
                <el-radio label="0">新建</el-radio>
                <el-radio label="1">改扩建</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="建设工期">
              <el-input :disabled="true" v-model="formInline.jsgq"></el-input>
            </el-form-item>
          </el-col> -->
          <el-col :span="24">
            <el-form-item label="设施建设标准" prop="ssjsbz">
              <el-input
                style="width: 100%"
                type="textarea"
                v-model="formInline.ssjsbz"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="form-section">拟用地情况</div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="项目区总面积(公顷)" prop="xmqzmj">
              <el-input v-model="formInline.xmqzmj"></el-input>
              <span v-show="formInline.xmqzmj" style="margin-left: 10px">
                <span style="color: red">{{
                  gongqinToMu(formInline.xmqzmj)
                }}</span
                >亩
                <span style="margin-left: 10px; color: red">{{
                  gongqinToMi(formInline.xmqzmj)
                }}</span
                >平方米
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="其中设施农用地面积(公顷)">
              <el-input
                v-model="formInline.ssnydmj"
                :disabled="true"
                @input="gongqinToMu"
              ></el-input>
              <span v-show="formInline.ssnydmj" style="margin-left: 10px">
                <span style="color: red">{{
                  gongqinToMu(formInline.ssnydmj)
                }}</span
                >亩
                <span style="margin-left: 10px; color: red">{{
                  gongqinToMi(formInline.ssnydmj)
                }}</span
                >平方米
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="其中露天种植面积(公顷)">
              <el-input v-model="formInline.ltzzmj" :disabled="true"></el-input>
              <span v-show="formInline.ltzzmj" style="margin-left: 10px">
                <span style="color: red">{{
                  gongqinToMu(formInline.ltzzmj)
                }}</span
                >亩
                <span style="margin-left: 10px; color: red">{{
                  gongqinToMi(formInline.ltzzmj)
                }}</span
                >平方米
              </span>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item>
              <sub-form-container-vue title="占用前土地地类及面积(公顷)">
                <sub-form-item-one-vue
                  title="耕地"
                  v-model="formInline.ssnydmjGd"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其中:永久基本农田"
                  v-model="formInline.ssnydmjYjjbnt"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
                 <sub-form-item-one-vue
                  title="园地"
                  v-model="formInline.ssnydmjYd"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="林地"
                  v-model="formInline.ssnydmjLd"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="养殖水面"
                  v-model="formInline.ssnydmjYz"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其他土地"
                  v-model="formInline.ssnydmjQttd"
                  @change="ssnydValueChange"
                  :disable="true"
                ></sub-form-item-one-vue>
              </sub-form-container-vue>
            </el-form-item>
          </el-col> -->
          <el-col :span="24">
            <el-form-item label="">
              <sub-form-container-vue>
                <sub-form-item-one-vue
                  title="规模化粮食种植"
                  v-model="formInline.ltzzmjLszz"
                  @change="ltzzmjValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="规模化种植"
                  v-model="formInline.ltzzmjZz"
                  @change="ltzzmjValueChange"
                ></sub-form-item-one-vue>
              </sub-form-container-vue>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="form-section">设施类型及面积</div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="生产设施用地(公顷)">
              <div
                style="display: flex; border: solid 1px #d8d8d8; padding: 5px"
              >
                <el-select v-model="currentScssyd" style="flex: 1">
                  <el-option
                    v-for="item in scssydData"
                    :key="item.value"
                    :label="item.dictLabel"
                    :value="item.dictcode"
                  >
                  </el-option>
                </el-select>
                <el-input
                  style="margin-left: 10px; flex: 2"
                  placeholder="请填写"
                  v-model="formInline[currentScssyd]"
                  @change="scssydValueChange"
                ></el-input>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item>
              <sub-form-container-vue title="其中拟用地情况(公顷)">
                <sub-form-item-one-vue
                  title="耕地"
                  v-model="formInline.scssFagd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其中:永久基本农田"
                  v-model="formInline.scssFayjjbnt"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="园地"
                  v-model="formInline.scssFayd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="林地"
                  v-model="formInline.scssFald"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="养殖水面"
                  v-model="formInline.scssFayzsm"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其他土地"
                  v-model="formInline.scssFaqttd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
              </sub-form-container-vue>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="辅助设施用地(公顷)">
              <div
                style="display: flex; border: solid 1px #d8d8d8; padding: 5px"
                v-for="(fzssyd,idx) in fzssydArray"
                :key='`fzssyd${idx}`'
              >
                <el-select v-model="fzssyd.type" 
                  style="flex: 1">
                  <el-option
                    v-for="item in fzssydData"
                    :key="item.value"
                    :label="item.dictLabel"
                    :value="item.dictcode"
                  >
                  </el-option>
                </el-select>
                <el-input
                  style="margin-left: 10px; flex: 2"
                  placeholder="请填写"
                  v-model="formInline[fzssyd.type]"
                  @change="fzssydValueChange"
                ></el-input>
                <el-button v-if="idx == 0" @click="fzssydArray.push({type:'',isOriginal:false})">添加</el-button>
                <el-button v-else type="danger" @click="deleteFzssydItem(idx,fzssyd)">删除</el-button>
              </div>

              <!-- <div
                style="
                  border: solid 1px #d8d8d8;
                  max-height: 270px;
                  overflow-y: scroll;
                "
              >
                <sub-form-item-two-vue
                  v-for="(item, idx) in fzssydData"
                  :key="'fzssydData' + idx"
                  :title="item.dictLabel || ''"
                  v-model="formInline[item.dictcode]"
                  @change="fzssydValueChange"
                  :bottom="idx != fzssydData.length - 1"
                ></sub-form-item-two-vue>
              </div> -->
            </el-form-item>
          </el-col>
          
          <el-col :span="24">
            <el-form-item>
              <sub-form-container-vue title="其中拟用地情况(公顷)">
                <sub-form-item-one-vue
                  title="耕地"
                  v-model="formInline.fzssFagd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其中:永久基本农田"
                  v-model="formInline.fzssFayjjbnt"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="园地"
                  v-model="formInline.fzssFayd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="林地"
                  v-model="formInline.fzssFald"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="养殖水面"
                  v-model="formInline.fzssFayzsm"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
                <sub-form-item-one-vue
                  title="其他土地"
                  v-model="formInline.fzssFaqttd"
                  @change="ssnydValueChange"
                ></sub-form-item-one-vue>
              </sub-form-container-vue>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="建设内容">
              <el-input
                v-model="formInline.scssjsnr"
                placeholder="xx结构的xx设施等，共占用xx公顷"
                type="textarea"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="建设内容">
              <el-input
                v-model="formInline.fzssjsnr"
                placeholder="xx结构的xx设施等，共占用xx公顷"
                type="textarea"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div class="form-section">其他事项</div>
          </el-col>
          <el-col :span="24">
            <el-form-item label="其他事项">
              <el-input type="textarea" v-model="formInline.qtsx"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item>
              <div style="display: flex; justify-content: center">
                <el-button @click="goBack" :disabled="false">返回</el-button>
                <el-button
                  v-if="formInline.status != '6'"
                  :disabled="!currentProject"
                  type="primary"
                  @click="submitForm('ruleForm')"
                  >下一步</el-button
                >
                <el-button v-else>已完成</el-button>
              </div>
            </el-form-item>
          </el-col>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import service from "@/apiService/apiService";
import SubForm from "@/components/SubForm.vue";
import SubFormItemTwoVue from "@/components/SubFormItemTwo.vue";
import SubFormContainerVue from "@/components/SubFormContainer.vue";
import SubFormItemOneVue from "@/components/SubFormItemOne.vue";

export default {
  components: {
    SubForm,
    SubFormItemTwoVue,
    SubFormContainerVue,
    SubFormItemOneVue,
  },
  data() {
    return {
      loading:false,
      fzssydArray:[{type:'',isOriginal:false}],
      projectName:'',
      isEditName:false,
      address:'',
      ssnydmj: [],
      ltzzmj: [],
      jsytData: [],
      scssydData: [],
      fzssydData: [],
      currentScssyd: "",
      currentFzssyd: "",
      formInline: {},
      areaSqM: 0,
      areaMu: 0,
      rules: {
        fayt: [{ required: true, message: "请选择用途", trigger: "change" }],
        ssjslx: [
          { required: true, message: "请选择建设类型", trigger: "change" },
        ],
        // ssjsbz: [{ required: true, message: "请输入", trigger: "blur" }],
        xmqzmj: [{ required: true, message: "请输入", trigger: "blur" }],
      },
      projectList: [],
      userInfo: {
        userVO: {},
        projectVOs: [],
      },
      disabled: true,
      currentProject: null,
      status: {
        1: "待交资料",
        2: "资料审核中",
        3: "待补交资料",
        4: "待交缴费凭证",
        5: "处理中",
        6: "已完成",
      },
      currnetId:'',
    };
  },
  mounted() {
    this.currnetId = this.$route.query.id 
    // let user = window.localStorage.getItem("userInfo");
    // if (user) {
    //   this.userInfo = JSON.parse(user);
    //   this.getProjectList();
    // } else {
    //   this.$router.replace("/");
    // }
    // 页头
    // document.querySelector(".header-site-sel").style.display = "block";
    // document.querySelector(".header-login-box").style.display = "inline-block";
    // document.querySelector(".logout-th").style.display = "inline-block";
    // document.querySelector(".login-th").style.display = "none";
    // document.querySelector(".register-th").style.display = "none";

    // 页尾
    // document.querySelector(".footer-bah").style.display = "block";
    // document.querySelector(".footer-zbdw").style.display = "block";
    // document.querySelector(".footer-fixed").style.display = "block";
    // document.querySelector(".footer-adr").style.display = "block";
    // document.querySelector(".footer-zfzc").style.display = "inline";
    // document.querySelector(".footer-dzjg").style.display = "inline";
    // document.querySelector(".footer-aqcx").style.display = "inline";
    this.getDict();
  },
  methods: {
    deleteFzssydItem(idx,item){
      // debugger
      // if (item.isOriginal) {
        this.formInline[item.type] = ''
      // }
      this.fzssydArray.splice(idx,1)
      this.fzssydValueChange()
    },
    goBack(){
      this.$router.back()
    },
    projectNameChange(val){
      this.formInline.projectName = val
    },
    editProjectName(){
      if (this.formInline.projectNo) {
        this.isEditName = !this.isEditName
      }else{
        this.$message({
          message: "请选择项目",
          type: "warning",
        });
      }
      
    },
    addressChange(val){
      this.formInline.address = val
    },
    loginOut() {
      this.$confirm("确认退出登录？")
        .then((_) => {
          window.localStorage.clear();
          this.$router.replace("/");
        })
        .catch((_) => {});
    },
    resend() {
      if (!this.formInline.projectNo) {
        this.$message({
          message: "请选择项目",
          type: "warning",
        });
        return;
      }
      service
        .saveProjectData({
          annexTypes: ["fj_sfzmcl"],
          jhlx: "apply",
          projectNo: this.formInline.projectNo,
        })
        .then((res) => {
          this.$message({
            message: "推送成功",
            type: "success",
          });
          this.getProjectList();
        })
        .catch((err) => {});
    },
    getStatus(val) {
      return this.status[val];
    },

    ltzzmjValueChange() {
      let temp1 = Number(this.formInline.ltzzmjLszz) || 0;
      let temp2 = Number(this.formInline.ltzzmjZz) || 0;
      this.formInline.ltzzmj = this.removeTrailingZeros(
        (temp1 + temp2).toFixed(6)
      );
    },
    ssnydValueChange() {
      let gd1 = Number(this.formInline.scssFagd) || 0;
      let gd2 = Number(this.formInline.fzssFagd) || 0;
      let ld1 = Number(this.formInline.scssFald) || 0;
      let ld2 = Number(this.formInline.fzssFald) || 0;
      let yd1 = Number(this.formInline.scssFayd) || 0;
      let yd2 = Number(this.formInline.fzssFayd) || 0;
      let yj1 = Number(this.formInline.scssFayjjbnt) || 0;
      let yj2 = Number(this.formInline.fzssFayjjbnt) || 0;
      let yz1 = Number(this.formInline.scssFayzsm) || 0;
      let yz2 = Number(this.formInline.fzssFayzsm) || 0;
      let qt1 = Number(this.formInline.scssFaqttd) || 0;
      let qt2 = Number(this.formInline.fzssFaqttd) || 0;

      this.formInline.ssnydmjGd = this.removeTrailingZeros(
        (gd1 + gd2).toFixed(6)
      );
      this.formInline.ssnydmjLd = this.removeTrailingZeros(
        (ld1 + ld2).toFixed(6)
      );
      this.formInline.ssnydmjYd = this.removeTrailingZeros(
        (yd1 + yd2).toFixed(6)
      );
      this.formInline.ssnydmjYjjbnt = this.removeTrailingZeros(
        (yj1 + yj2).toFixed(6)
      );
      this.formInline.ssnydmjYz = this.removeTrailingZeros(
        (yz1 + yz2).toFixed(6)
      );
      this.formInline.ssnydmjQttd = this.removeTrailingZeros(
        (qt1 + qt2).toFixed(6)
      );
      let temp1 = Number(this.formInline.ssnydmjGd) || 0;
      let temp2 = Number(this.formInline.ssnydmjLd) || 0;
      let temp3 = Number(this.formInline.ssnydmjYd) || 0;
      let temp4 = Number(this.formInline.ssnydmjYjjbnt) || 0;
      let temp5 = Number(this.formInline.ssnydmjYz) || 0;
      let temp6 = Number(this.formInline.ssnydmjQttd) || 0;

      this.formInline.ssnydmj = (temp1 + temp2 + temp3 + temp5 + temp6).toFixed(
        6
      );
      this.formInline.ssnydmj = this.removeTrailingZeros(
        this.formInline.ssnydmj
      );
    },
    scssydValueChange() {
      let temp = 0;
      for (let i = 0; i < this.scssydData.length; i++) {
        const item = this.scssydData[i];
        let temp1 = Number(this.formInline[item.dictcode]) || 0;
        temp = temp + temp1;
      }
      this.formInline.scssydmj = this.removeTrailingZeros(temp.toFixed(6));
    },
    fzssydValueChange() {
      let temp = 0;
      for (let i = 0; i < this.fzssydData.length; i++) {
        const item = this.fzssydData[i];
        let temp1 = Number(this.formInline[item.dictcode]) || 0;
        temp = temp + temp1;
      }
      this.formInline.fzssmj = this.removeTrailingZeros(temp.toFixed(6));
    },
    removeTrailingZeros(num) {
      // 将数字转换为字符串
      let str = num.toString();
      // 使用正则表达式移除尾部的零
      return str.replace(/\.?0+$/, "");
    },
    gongqinToMu(val) {
      let temp = Number(val);
      return (temp * 15).toFixed(2);
    },
    gongqinToMi(val) {
      let temp = Number(val);
      return (temp * 10000).toFixed(2);
    },
    async getDict() {
      let res1 = await service.getDictData("ssnyd-jsyt");
      this.jsytData = res1.data;
      let res2 = await service.getDictData("ssnyd-scssydlx");
      this.scssydData = res2.data;
      this.currentScssyd = this.scssydData[0].dictcode;
      let res3 = await service.getDictData("ssnyd-fzssydlx");
      this.fzssydData = res3.data;
      this.currentFzssyd = this.fzssydData[0].dictcode;
      let res4 = await service.getDictData("ssnyd-zyqtdlx");
      this.ssnydmj = res4.data;
      let res5 = await service.getDictData("ssnyd-ltzzlx");
      this.ltzzmj = res5.data;
      this.loadProjectDetail()

    },
    projectChange(val) {
      this.currentProject = this.projectList.find(
        (item) => item.projectNo == val
      );
      this.formInline = { ...this.currentProject };
      window.localStorage.setItem(
        "currentProject",
        JSON.stringify(this.formInline)
      );
      this.formInline.address = this.formInline.sqmc;
      this.address = this.formInline.address
      this.projectName = this.formInline.projectName
      // this.loadProjectDetail();
    },
    userTypeChange(val) {},

    submitForm() {
      let arr = ['2','4','5','6']
      if (arr.includes(this.formInline.status)) {
        this.$router.push("home");
        return
      }
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.saveData();
        } else {
          // console.log("error submit!!");
          this.$message({
            message: "请完善必填项",
            type: "warning",
          });
        }
      });
    },
    saveData() {
      this.formInline.sqmc = this.address
      service
        .editProject(this.formInline)
        .then((res) => {
          this.$router.push("home");
        })
        .catch((err) => {
          this.$message({
            message: err,
            type: "warning",
          });
        });
    },

    // getProjectList() {
    //   service
    //     .getProjectListData({
    //       pageSize: 1000,
    //       currentPage: 0,
    //       // status:1,
    //       telephone: this.userInfo.userVO.telephone,
    //     })
    //     .then((res) => {
    //       this.projectList = res.data.records;
    //     })
    //     .catch((err) => {
    //       console.log(err);
    //     });
    // },
    loadProjectDetail(){
      this.loading = true
      service.getProjectInfoDetail(
        this.currnetId
      ).then(res=>{
        this.currentProject = res.data
        this.formInline = { ...this.currentProject };
        window.localStorage.setItem(
          "currentProject",
          JSON.stringify(this.formInline)
        );
        this.formInline.address = this.formInline.sqmc;
        this.address = this.formInline.address
        this.projectName = this.formInline.projectName
        this.getFsssydData()
      }).catch(err=>{

      }).finally(()=>{
        this.loading = false
      })
    },
    //处理辅助设施用地的数据回显
    getFsssydData(){
      let tempArr = []
      this.fzssydData.forEach(item=>{
        let val = this.formInline[item.dictcode]
        if (val != null && val != 0) {
          let tempItem = {
            type:item.dictcode,
            isOriginal:true,//从服务器返回的数据
          }
          tempArr.push(tempItem)
        }
      })
      if (tempArr.length > 0) {
        this.fzssydArray = tempArr
      }
    }
  },
};
</script>

<style scoped lang="less">
.ssnyd {
  margin: 20px 0px;
  .ssnyd-unit {
    color: #666666;
  }
}
.form-box {
  .form-section {
    font-size: 18px;
    font-weight: 500;
    line-height: 17px;
    color: #000000;
    padding-left: 13px;
    border-left: solid 4px #0c7cff;
    margin: 20px 0px;
  }
}

.xmxx {
  margin-bottom: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-item-span {
  margin-right: 5px;
}

.el-input {
  width: 350px;
  /* 调整为所需的宽度 */
}

.container {
  display: flex;
  //height: 1200px;
  /* 
  width: 100%;
  background-color: #aaa; */
}

.el-divider--horizontal {
  margin: 10px 0;
}

.name {
  font-weight: 500;
  font-size: 22px;
  color: #000000;
  line-height: 30px;
  display: flex;
  justify-content: space-between;
  .status-1,
  .status-2,
  .status-3,
  .status-4,
  .status-5 {
    background-color: #0c7cff;
    color: #fff;
    padding: 0px 14px;
    border-radius: 15px;
    font-size: 13px;
  }
  .status-6 {
    background-color: green;
    color: #fff;
    padding: 0px 14px;
    border-radius: 15px;
    font-size: 13px;
  }
  .re-send {
    padding: 0px 14px;
    border-radius: 15px;
    font-size: 13px;
  }
}

.header {
  display: flex;
  align-items: center;
  /* width: 100%; */
  height: 56px;
  padding: 0 150px;
  border: 1px solid #eee;
  margin-bottom: 18px;
}

.main {
  // width: 100%;
  height: 100%;
  padding: 0 150px;
}

.footer {
  height: 80px;
  line-height: 80px;
  /* background-color: pink; */
  span-align: center;
  border-radius: 10px;
}

.syName {
  color: #333;
  font-weight: bold;
  font-size: 18px;
}

.sy {
  padding: 5px 20px;
  color: #333;
  font-weight: bold;
  font-size: 18px;
}

.title {
  padding: 10px 150px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  cursor: pointer;
}
.el-icon-user {
  border: solid 1px #333;
  border-radius: 20px;
  padding: 4px;
}

/deep/ .el-button--primary{
  background-color: #0c7cff !important;
}
</style>
